import { legacy_createStore as createStore, applyMiddleware, combineReducers } from 'redux'

// 引入为count组件服务的reducer
import countReducer from './reducers/count'

// 引入person组件服务的reducer
import personReducer from './reducers/person'

// redux-thunk 异步action
import thunk from 'redux-thunk'

// redux devtools
import { composeWithDevTools } from 'redux-devtools-extension'

//合并多个reducers
const addReducer = combineReducers({
  count: countReducer,
  persons: personReducer
})


export default createStore(addReducer, composeWithDevTools(applyMiddleware(thunk)))
